<?php

require(DIR_FS_CATALOG.'/shopgate/includes.php');
$shopgate_config = ShopgateConfig::getConfig();

if(!file_exists(SHOPGATE_BASE_DIR.'/myconfig.php')
&& file_exists(SHOPGATE_BASE_DIR.'/plugins/gambiogx/default_config.php')) {
	include SHOPGATE_BASE_DIR.'/plugins/gambiogx/default_config.php';
}

$message = "";
if($_GET["action"] === "save") {
	if(isset($_POST["shopgate_config"])) 
		$shopgate_config = array_merge($shopgate_config, $_POST["shopgate_config"]);
	
	try {
		ShopgateConfig::setConfig($shopgate_config);
		ShopgateConfig::saveConfig();
		xtc_redirect(FILENAME_SHOPGATE."?sg_option=".$_GET["sg_option"]);
	} catch (ShopgateFrameworkException $e) {
		$message = $e->lastResponse;
	}
}

$sgOrderStatus = array();
$qry = xtc_db_query("
	SELECT orders_status_id, orders_status_name
	FROM orders_status os
	JOIN languages l ON l.languages_id = os.language_id
	WHERE l.code = 'de'
	ORDER BY os.orders_status_id");

while ($row = xtc_db_fetch_array($qry)) {
	$sgOrderStatus[] = $row;
}
	
$sgCustomerGroups = array( array("customers_status_id" => -1, "customers_status_name" => "Standard") );
$qry = xtc_db_query("
	SELECT
		s.customers_status_id,
		s.customers_status_name
	FROM `".TABLE_CUSTOMERS_STATUS."` s
	JOIN `".TABLE_LANGUAGES."` lng ON s.language_id = lng.languages_id 
	WHERE UPPER(lng.code) = 'DE'
");
while ($row = xtc_db_fetch_array($qry)) {
	$sgCustomerGroups[] = $row;
}
	
$sgTaxZones = array();
$qry = xtc_db_query("
	SELECT
		geo_zone_id,
		geo_zone_name,
		geo_zone_description
	FROM `".TABLE_GEO_ZONES."`
	ORDER BY geo_zone_id
");
while ($row = xtc_db_fetch_array($qry)) {
	$sgTaxZones[] = $row;
}

$sgCurrencies = array();
$qry = xtc_db_query("
	SELECT
		code,
		title
	FROM `".TABLE_CURRENCIES."`
	ORDER BY code
");
while ($row = xtc_db_fetch_array($qry)) {
	$sgCurrencies[] = $row;
}

$sgLanguages = array();
$qry = xtc_db_query("
	SELECT
		UPPER(code) AS code,
		name
	FROM `".TABLE_LANGUAGES."`
	ORDER BY code
");
while ($row = xtc_db_fetch_array($qry)) {
	$sgLanguages[] = $row;
}

$sgCountries = array();
$qry = xtc_db_query("
	SELECT
		UPPER(countries_iso_code_2) AS countries_iso_code_2,
		countries_name
	FROM `".TABLE_COUNTRIES."`
	WHERE status = 1
	ORDER BY countries_iso_code_2
");
while ($row = xtc_db_fetch_array($qry)) {
	$sgCountries[] = $row;
}
	
?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type"
	content="text/html; charset=<?php echo $_SESSION['language_charset']; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script type="text/javascript" src="includes/general.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0"
	leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
	<!-- header //-->
	<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
	<!-- header_eof //-->

	<!-- body //-->
	<table border="0" width="100%" cellspacing="2" cellpadding="2">
		<tr>
			<td class="columnLeft2" width="<?php echo BOX_WIDTH; ?>" valign="top">
			<table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1"
					cellpadding="1" class="columnLeft">
					<!-- left_navigation //-->
					<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
					<!-- left_navigation_eof //-->
				</table>
			</td>
			<!-- body_text //-->
			<td class="boxCenter" width="100%" valign="top" style="height:100%;">
				<table border="0" width="100%" cellspacing="0" cellpadding="2" style="height:100%;">
					<tr>
						<td>
							<div class="pageHeading" style="background-image: url(images/gm_icons/module.png)">SHOPGATE</div>
						</td>
					</tr>
					<tr style="height:100%;">
						<td class="main" style="height:100%; vertical-align: top;">
<? if(!empty($message)):?>
<div style="background: #FFD6D9; width; 100%; padding: 10px;">
<strong style="color:red;">FEHLER:</strong>
<?= htmlentities( $message , ENT_COMPAT, "UTF-8") ?>
</div>
<? endif; ?>						
<? if ($_GET["sg_option"] === "info"): ?>
<iframe src="http://www.shopgate.com/de/sell" style="width: 1000px; min-height: 600px; height: 100%; border: 0;"></iframe>
<? elseif($_GET["sg_option"] === "help"): ?>
<iframe src="http://www.shopgate.com/shoppingsystems/tutorial/55" style="width: 1000px; min-height: 600px; height: 100%; border: 0;"></iframe>
<? elseif($_GET["sg_option"] === "register"): ?>
<iframe src="https://www.shopgate.com/welcome/shop_register" style="width: 1000px; min-height: 600px; height: 100%; border: 0;"></iframe>
<? elseif($_GET["sg_option"] === "config"): ?>
<table>
<tr>
<td style="width:1050px;" align="right">

<?= xtc_draw_form('shopgate', FILENAME_SHOPGATE, 'sg_option=config&action=save'); ?>
	
	<table width="100%" cellspacing="0" cellpadding="4" border="0" style="border-bottom: 1px dotted #5a5a5a">
  	<tr valign="top" bgcolor="<?= $alt=="#d6e6f3"?$alt="#f7f7f7":$alt="#d6e6f3"?>">
    	<td width="300" class="dataTableContent_gm"><b>Shopgate Kundennummer</b></td>
    	<td class="dataTableContent_gm">
    		<table width="100%" cellspacing="0" cellpadding="2" border="0">
			<tr>
        		<td class="dataTableContent_gm">
        			<input type="text" name="shopgate_config[customer_number]" value="<?= $shopgate_config["customer_number"]?>"/>
        		</td>
      		</tr>
    		</table>
   			<br>
   				Tragen Sie hier ihre Kundennummer bei Shopgate ein. Sie finden diese (<a href="http://www.shopgatepg.com/merchant/user_detail/address" target="_blank">hier</a>) in den Stammdaten Ihres Accounts.<br><br>
   			</td>
  			</tr>
	</table>

	<table width="100%" cellspacing="0" cellpadding="4" border="0" style="border-bottom: 1px dotted #5a5a5a">
  	<tr valign="top" bgcolor="<?= $alt=="#d6e6f3"?$alt="#f7f7f7":$alt="#d6e6f3"?>">
    	<td width="300" class="dataTableContent_gm"><b>Shopnummer</b></td>
    	<td class="dataTableContent_gm">
    		<table width="100%" cellspacing="0" cellpadding="2" border="0">
			<tr>
        		<td class="dataTableContent_gm">
        			<input type="text" name="shopgate_config[shop_number]" value="<?= $shopgate_config["shop_number"]?>" />
        		</td>
      		</tr>
    		</table>
   			<br>
   				Tragen Sie hier ihre Shopnummer ein. Sie finden diese (<a href="http://www.shopgatepg.com/merchant/shops" target="_blank">hier</a>) in der &Uuml;bersicht Ihrer Shops in Ihrem Account.<br><br>
   			</td>
  			</tr>
	</table>

	<table width="100%" cellspacing="0" cellpadding="4" border="0" style="border-bottom: 1px dotted #5a5a5a">
  	<tr valign="top" bgcolor="<?= $alt=="#d6e6f3"?$alt="#f7f7f7":$alt="#d6e6f3"?>">
    	<td width="300" class="dataTableContent_gm"><b>API-Key</b></td>
    	<td class="dataTableContent_gm">
    		<table width="100%" cellspacing="0" cellpadding="2" border="0">
			<tr>
        		<td class="dataTableContent_gm">
        			<input type="text" name="shopgate_config[apikey]" value="<?= $shopgate_config["apikey"]?>" />
        		</td>
      		</tr>
    		</table>
   			<br>
   				Tragen Sie hier ihren API-Key ein. Sie finden diesen (<a href="http://www.shopgatepg.com/merchant/apikey" target="_blank">hier</a>) in den Stammdaten Ihres Accounts.<br><br>
   			</td>
  			</tr>
	</table>

	<table width="100%" cellspacing="0" cellpadding="4" border="0" style="border-bottom: 1px dotted #5a5a5a">
  	<tr valign="top" bgcolor="<?= $alt=="#d6e6f3"?$alt="#f7f7f7":$alt="#d6e6f3"?>">
    	<td width="300" class="dataTableContent_gm"><b>Bei Shopgate frei geschaltet</b></td>
    	<td class="dataTableContent_gm">
    		<table width="100%" cellspacing="0" cellpadding="2" border="0">
			<tr>
        		<td class="dataTableContent_gm">
        			<input type="radio" <?= $shopgate_config["shop_is_active"]?'checked=""':''?> value="true" name="shopgate_config[shop_is_active]"> Ja<br>
        			<input type="radio" <?= !$shopgate_config["shop_is_active"]?'checked=""':''?> value="false" name="shopgate_config[shop_is_active]"> Nein<br>
        		</td>
      		</tr>
    		</table>
   			<br>
   				Ist Ihr Shop bei Shopgate freigeschaltet?<br>
   				<strong>Hinweis:</strong> Einige Funktionen werden erst freigeschaltet, wenn diese Option auf Ja steht. (Beispiel: QR-Code)<br><br>
   			</td>
  			</tr>
	</table>
	
	<table width="100%" cellspacing="0" cellpadding="4" border="0" style="border-bottom: 1px dotted #5a5a5a">
  	<tr valign="top" bgcolor="<?= $alt=="#d6e6f3"?$alt="#f7f7f7":$alt="#d6e6f3"?>">
    	<td width="300" class="dataTableContent_gm"><b>Erstellung der CSV-Datei</b></td>
    	<td class="dataTableContent_gm">
    		<table width="100%" cellspacing="0" cellpadding="2" border="0">
			<tr>
        		<td class="dataTableContent_gm">
        			<input type="radio" <?= $shopgate_config["generate_items_csv_on_the_fly"]?'checked=""':''?> checked="" value="true" name="shopgate_config[generate_items_csv_on_the_fly]"> Live (CSV automatisch generieren)<br>
        			<input type="radio" <?= !$shopgate_config["generate_items_csv_on_the_fly"]?'checked=""':''?> value="false" name="shopgate_config[generate_items_csv_on_the_fly]"> Cron (CSV wird nur abgeholt)<br>
        		</td>
      		</tr>
    		</table>
   			<br>
   				Die CSV-Dateien k&ouml;nnen bei jedem abfragen automatisch generiert werden.
   				Wenn Sie die Erstellung manuell Kontrollieren m&ouml;chten, k&ouml;nnen Sie dese auch &uuml;ber Cron geschehen lassen.<br><br>
   				<strong>Cron-Eintr&auml;ge:</strong><br />
   				0 * * * * /usr/bin/php /pfad/zu/ihrem/shop/shopgate/cronjobs/update_items_csv.php #items-csv<br />
   				0 23 * * * /usr/bin/php /pfad/zu/ihrem/shop/shopgate/cronjobs/update_reviews_csv.php #reviews-csv 
   			</td>
  			</tr>
	</table>

	<table width="100%" cellspacing="0" cellpadding="4" border="0" style="border-bottom: 1px dotted #5a5a5a">
  	<tr valign="top" bgcolor="<?= $alt=="#d6e6f3"?$alt="#f7f7f7":$alt="#d6e6f3"?>">
    	<td width="300" class="dataTableContent_gm"><b>Kundenbewertungen</b></td>
    	<td class="dataTableContent_gm">
    		<table width="100%" cellspacing="0" cellpadding="2" border="0">
			<tr>
        		<td class="dataTableContent_gm">
        			<input type="radio" <?= $shopgate_config["enable_get_reviews_csv"]?'checked=""':''?> value="true" name="shopgate_config[enable_get_reviews_csv]"> Ja, Bewertungen exportieren<br>
        			<input type="radio" <?= !$shopgate_config["enable_get_reviews_csv"]?'checked=""':''?> value="false" name="shopgate_config[enable_get_reviews_csv]"> Nein, Bewertungen nicht exportieren<br>
        		</td>
      		</tr>
    		</table>
   			<br>
   				Geben Sie an, ob die Bewertungen aus Ihrem Shopsystem auch bei Shopgate angezeigt werden sollen<br><br>
   			</td>
  			</tr>
	</table>

	<table width="100%" cellspacing="0" cellpadding="4" border="0" style="border-bottom: 1px dotted #5a5a5a">
  	<tr valign="top" bgcolor="<?= $alt=="#d6e6f3"?$alt="#f7f7f7":$alt="#d6e6f3"?>">
    	<td width="300" class="dataTableContent_gm"><b>Bestellungen</b></td>
    	<td class="dataTableContent_gm">
    		<table width="100%" cellspacing="0" cellpadding="2" border="0">
			<tr>
        		<td class="dataTableContent_gm">
        			<input type="radio" <?= $shopgate_config["enable_http_alert"]?'checked=""':''?> value="true" name="shopgate_config[enable_http_alert]"> Ja, Bestellungen sollen in dieses System importiert werden<br>
        			<input type="radio" <?= !$shopgate_config["enable_http_alert"]?'checked=""':''?> value="false" name="shopgate_config[enable_http_alert]"> Nein, Bestellungen sollen nicht in dieses System importiert werden<br>
        		</td>
      		</tr>
    		</table>
   			<br>
   				Geben Sie an, ob die Bestellungen bei Shopgate wieder in dieses System zur&uuml;ck gespielt werden sollen.<br><br>
   			</td>
  			</tr>
	</table>

	
	<table width="100%" cellspacing="0" cellpadding="4" border="0" style="border-bottom: 1px dotted #5a5a5a">
  	<tr valign="top" bgcolor="<?= $alt=="#d6e6f3"?$alt="#f7f7f7":$alt="#d6e6f3"?>">
    	<td width="300" class="dataTableContent_gm"><b>Kundenlogin &uuml;ber Shopgate</b></td>
    	<td class="dataTableContent_gm">
    		<table width="100%" cellspacing="0" cellpadding="2" border="0">
			<tr>
        		<td class="dataTableContent_gm">
        			<input type="radio" <?= $shopgate_config["enable_connect"]?'checked=""':''?> value="true" name="shopgate_config[enable_connect]"> Ja<br>
        			<input type="radio" <?= !$shopgate_config["enable_connect"]?'checked=""':''?> value="false" name="shopgate_config[enable_connect]"> Nein<br>
        		</td>
      		</tr>
    		</table>
   			<br>
   				D&uuml;rfen sich bei Ihnen bereits existierende Kunden &uuml;ber die Shopgate-App einloggen? Bestellungen werden den bestehenden Kunden dann automatisch zugewiesen.<br><br>
   			</td>
  			</tr>
	</table>

	<table width="100%" cellspacing="0" cellpadding="4" border="0" style="border-bottom: 1px dotted #5a5a5a">
  	<tr valign="top" bgcolor="<?= $alt=="#d6e6f3"?$alt="#f7f7f7":$alt="#d6e6f3"?>">
    	<td width="300" class="dataTableContent_gm"><b>Mobile Webseite</b></td>
    	<td class="dataTableContent_gm">
    		<table width="100%" cellspacing="0" cellpadding="2" border="0">
			<tr>
        		<td class="dataTableContent_gm">
        			<input type="radio" <?= $shopgate_config["enable_mobile_website"]?'checked=""':''?> value="true" name="shopgate_config[enable_mobile_website]"> Ja<br>
        			<input type="radio" <?= !$shopgate_config["enable_mobile_website"]?'checked=""':''?> value="false" name="shopgate_config[enable_mobile_website]"> Nein<br>
        		</td>
      		</tr>
    		</table>
   			<br>
   				M&ouml;chten Sie Besucher mit einem mobilen Device auf ihrer Webseite auf Ihre App aufmerksam machen?<br><br>
   			</td>
  			</tr>
	</table>
            
	<input type="submit" value="Speichern" onclick="this.blur();" class="button">
</form>
</td>
</tr>
</table>
<? elseif ($_GET["sg_option"] === "config_ext"): ?>

<table>
<tr>
<td style="width:1050px;" align="right">

<?= xtc_draw_form('shopgate', FILENAME_SHOPGATE, 'sg_option=config_ext&action=save'); ?>
	
	<table width="100%" cellspacing="0" cellpadding="4" border="0" style="border-bottom: 1px dotted #5a5a5a">
  	<tr valign="top" bgcolor="<?= $alt=="#d6e6f3"?$alt="#f7f7f7":$alt="#d6e6f3"?>">
    	<td width="300" class="dataTableContent_gm"><b>W&auml;hrung</b></td>
    	<td class="dataTableContent_gm">
    		<table width="100%" cellspacing="0" cellpadding="2" border="0">
			<tr>
        		<td class="dataTableContent_gm">
        			<select name="shopgate_config[plugin_currency]">
        				<? foreach($sgCurrencies as $sgCurrency): ?>
        					<option value="<?=$sgCurrency["code"]?>" <?= $shopgate_config["plugin_currency"]==$sgCurrency["code"]?'selected=""':''?>>
        						<?=$sgCurrency["title"]?>
        					</option>
        				<? endforeach; ?>
        			</select>
        		</td>
      		</tr>
    		</table>
   			<br>
   				Welche W&auml;hrung soll f&uuml;r den Export verwendet werden?<br><br>
   			</td>
  			</tr>
	</table>
	
	<table width="100%" cellspacing="0" cellpadding="4" border="0" style="border-bottom: 1px dotted #5a5a5a">
  	<tr valign="top" bgcolor="<?= $alt=="#d6e6f3"?$alt="#f7f7f7":$alt="#d6e6f3"?>">
    	<td width="300" class="dataTableContent_gm"><b>Sprache</b></td>
    	<td class="dataTableContent_gm">
    		<table width="100%" cellspacing="0" cellpadding="2" border="0">
			<tr>
        		<td class="dataTableContent_gm">
        			<select name="shopgate_config[plugin_language]">
        				<? foreach($sgLanguages as $sgLanguage): ?>
        					<option value="<?=$sgLanguage["code"]?>" <?= $shopgate_config["plugin_language"]==$sgLanguage["code"]?'selected=""':''?>>
        						<?=$sgLanguage["name"]?>
        					</option>
        				<? endforeach; ?>
        			</select>
        		</td>
      		</tr>
    		</table>
   			<br>
   				Welche Sprache soll f&uuml;r den Export verwendet werden?<br><br>
   			</td>
  			</tr>
	</table>
	
	<table width="100%" cellspacing="0" cellpadding="4" border="0" style="border-bottom: 1px dotted #5a5a5a">
  	<tr valign="top" bgcolor="<?= $alt=="#d6e6f3"?$alt="#f7f7f7":$alt="#d6e6f3"?>">
    	<td width="300" class="dataTableContent_gm"><b>Land f&uuml;r Shopgate</b></td>
    	<td class="dataTableContent_gm">
    		<table width="100%" cellspacing="0" cellpadding="2" border="0">
			<tr>
        		<td class="dataTableContent_gm">
        			<select name="shopgate_config[plugin_country]">
        				<? foreach($sgCountries as $sgCountry): ?>
        					<option value="<?=$sgCountry["countries_iso_code_2"]?>" <?= $shopgate_config["plugin_country"]==$sgCountry["countries_iso_code_2"]?'selected=""':''?>>
        						<?= $sgCountry["countries_name"]?>
        					</option>
        				<? endforeach; ?>
        			</select>
        		</td>
      		</tr>
    		</table>
   			<br>
   				Geben Sie die Steuerzone an, die f&uuml;r Shopgate g&uuml;ltig sein soll.<br /><br />
   			</td>
  			</tr>
	</table>
	
	<table width="100%" cellspacing="0" cellpadding="4" border="0" style="border-bottom: 1px dotted #5a5a5a">
  	<tr valign="top" bgcolor="<?= $alt=="#d6e6f3"?$alt="#f7f7f7":$alt="#d6e6f3"?>">
    	<td width="300" class="dataTableContent_gm"><b>Steuerzone f&uuml;r Shopgate</b></td>
    	<td class="dataTableContent_gm">
    		<table width="100%" cellspacing="0" cellpadding="2" border="0">
			<tr>
        		<td class="dataTableContent_gm">
        			<select name="shopgate_config[tax_zone_id]">
        				<? foreach($sgTaxZones as $sgTaxZone): ?>
        					<option value="<?=$sgTaxZone["geo_zone_id"]?>" <?= $shopgate_config["tax_zone_id"]==$sgTaxZone["geo_zone_id"]?'selected=""':''?>>
        						<?= $sgTaxZone["geo_zone_name"]?> (<?=$sgTaxZone["geo_zone_id"]?>)
        					</option>
        				<? endforeach; ?>
        			</select>
        		</td>
      		</tr>
    		</table>
   			<br>
   				Geben Sie die Steuerzone an, die f&uuml;r Shopgate g&uuml;ltig sein soll.<br /><br />
   			</td>
  			</tr>
	</table>
	
	<table width="100%" cellspacing="0" cellpadding="4" border="0" style="border-bottom: 1px dotted #5a5a5a">
  	<tr valign="top" bgcolor="<?= $alt=="#d6e6f3"?$alt="#f7f7f7":$alt="#d6e6f3"?>">
    	<td width="300" class="dataTableContent_gm"><b>Verstandstatus</b></td>
    	<td class="dataTableContent_gm">
    		<table width="100%" cellspacing="0" cellpadding="2" border="0">
			<tr>
        		<td class="dataTableContent_gm">
        			<select name="shopgate_config[order_shipped_status]">
        				<? foreach($sgOrderStatus as $sgOrderStatus): ?>
        					<option value="<?=$sgOrderStatus["orders_status_id"]?>" <?= $shopgate_config["order_shipped_status"]==$sgOrderStatus["orders_status_id"]?'selected=""':''?>>
        						<?=$sgOrderStatus["orders_status_name"]?> (<?=$sgOrderStatus["orders_status_id"]?>)
        					</option>
        				<? endforeach; ?>
        			</select>
        		</td>
      		</tr>
    		</table>
   			<br>
   				Bei welchem Status soll die Bestellung bei Shopgate aktualisiert werden?<br><br>
   			</td>
  			</tr>
	</table>
	
	<table width="100%" cellspacing="0" cellpadding="4" border="0" style="border-bottom: 1px dotted #5a5a5a">
  	<tr valign="top" bgcolor="<?= $alt=="#d6e6f3"?$alt="#f7f7f7":$alt="#d6e6f3"?>">
    	<td width="300" class="dataTableContent_gm"><b>Kundengruppe</b></td>
    	<td class="dataTableContent_gm">
    		<table width="100%" cellspacing="0" cellpadding="2" border="0">
			<tr>
        		<td class="dataTableContent_gm">
        			<select name="shopgate_config[customers_status_id]">
        				<? foreach($sgCustomerGroups as $sgCustomerGroup): ?>
        					<option value="<?=$sgCustomerGroup["customers_status_id"]?>" <?= $shopgate_config["customers_status_id"]==$sgCustomerGroup["customers_status_id"]?'selected=""':''?>>
        						<?=$sgCustomerGroup["customers_status_name"]?>
        					</option>
        				<? endforeach; ?>
        			</select>
        		</td>
      		</tr>
    		</table>
   			<br>
   				Welcher Kundengruppe soll ein neuer Kunde zugewiesen werden?<br />(Standard: In Gambio gew&auml;hlte Kundengruppe)<br><br>
   			</td>
  			</tr>
	</table>
	
	<input type="submit" value="Speichern" onclick="this.blur();" class="button">
</form>
</td>
</tr>
</table>

<? elseif ($_GET["sg_option"] === "qrcode"): ?>

<?= xtc_draw_form('shopgate', FILENAME_SHOPGATE, 'sg_option=qrcode&action=save'); ?>
	<table width="100%" cellspacing="0" cellpadding="4" border="0" style="border-bottom: 1px dotted #5a5a5a">
  	<tr valign="top" bgcolor="<?= $alt=="#d6e6f3"?$alt="#f7f7f7":$alt="#d6e6f3"?>">
    	<td width="300" class="dataTableContent_gm"><b>QR-Code Anzeigen</b></td>
    	<td class="dataTableContent_gm">
    		<table width="100%" cellspacing="0" cellpadding="2" border="0">
			<tr>
        		<td class="dataTableContent_gm">
        			<input type="radio" <?= $shopgate_config["show_qrcode"]?'checked=""':''?> value="true" name="shopgate_config[show_qrcode]"> Ja<br>
        			<input type="radio" <?= !$shopgate_config["show_qrcode"]?'checked=""':''?> value="false" name="shopgate_config[show_qrcode]"> Nein<br>
        		</td>
      		</tr>
    		</table>
   			<br>
   				Einen QR-Code unter den Produten Anzeigen.
   				
   				Beispiel: <br />
   				<img src="../shopgate/templates/images/qrbox_sample.png" /><br />
   				<br />
   				
   				Um diesen QR-Code anzuzeigen Platzieren Sie folgendes in Ihrem Produkt-Template unter<br />
   				templates/IHR-TEMPLATE/module/product_info/standard.html.<br />
   				
   				<pre style="align: left;">{$SHOPGATE_QR_BOX}</pre>
   				<br /><br />
   				Beipiel:
   				<pre>
... CODE ...
	{if $SHOW_BOOKMARKING || $SHOW_FACEBOOK}
		&lt;script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"&gt;&lt;/script&gt;
	{/if}
&lt;/div&gt;
{$SHOPGATE_QR_BOX}
&lt;div class="description tabs"&gt;
	&lt;div id="description-1"&gt;
... CODE ...
   				</pre>
   			</td>
  			</tr>
	</table>


	<table width="100%" cellspacing="0" cellpadding="4" border="0" style="border-bottom: 1px dotted #5a5a5a">
  	<tr valign="top" bgcolor="<?= $alt=="#d6e6f3"?$alt="#f7f7f7":$alt="#d6e6f3"?>">
    	<td width="300" class="dataTableContent_gm"><b>Aktion nach Scannen</b></td>
    	<td class="dataTableContent_gm">
    		<table width="100%" cellspacing="0" cellpadding="2" border="0">
			<tr>
        		<td class="dataTableContent_gm">
        			<input type="radio" <?= $shopgate_config["qr_destination"] == "8" ?'checked=""':''?> value="8" name="shopgate_config[qr_destination]"> Direkt zur Kasse<br>
        			<input type="radio" <?= $shopgate_config["qr_destination"] == "7" ?'checked=""':''?> value="7" name="shopgate_config[qr_destination]"> Produktseite Anzeigen<br>
        		</td>
      		</tr>
    		</table>
   			<br>
   				Nach dem Scannen des QR-Codes kann der Kunde auf die Detail-Seite des Produktes in der App geleitet werden oder aber dirket an die Kasse um zu bezahlen<br><br>
   			</td>
  			</tr>
	</table>
	
	<table width="100%" cellspacing="0" cellpadding="4" border="0" style="border-bottom: 1px dotted #5a5a5a">
  	<tr valign="top" bgcolor="<?= $alt=="#d6e6f3"?$alt="#f7f7f7":$alt="#d6e6f3"?>">
    	<td width="300" class="dataTableContent_gm"><b>Haben Sie eine eigene iPhone-App</b></td>
    	<td class="dataTableContent_gm">
    		<table width="100%" cellspacing="0" cellpadding="2" border="0">
			<tr>
        		<td class="dataTableContent_gm">
        			<input type="radio" <?= $shopgate_config["has_own_app"]?'checked=""':''?> value="true" name="shopgate_config[has_own_app]"> Ja, ich habe einen eigene iPhone-App<br>
        			<input type="radio" <?= !$shopgate_config["has_own_app"]?'checked=""':''?> value="false" name="shopgate_config[has_own_app]"> Nein, ich habe keine eigene iPhone-App<br>
        		</td>
      		</tr>
    		</table>
   			<br>
   				<br><br>
   			</td>
  			</tr>
	</table>
	
	<table width="100%" cellspacing="0" cellpadding="4" border="0" style="border-bottom: 1px dotted #5a5a5a">
  	<tr valign="top" bgcolor="<?= $alt=="#d6e6f3"?$alt="#f7f7f7":$alt="#d6e6f3"?>">
    	<td width="300" class="dataTableContent_gm"><b>Link zur eigenen iPhone-App</b></td>
    	<td class="dataTableContent_gm">
    		<table width="100%" cellspacing="0" cellpadding="2" border="0">
			<tr>
        		<td class="dataTableContent_gm">
        			<input type="text" value="<?= $shopgate_config["itunes_link"] ?>" name="shopgate_config[itunes_link]" /><br />
        		</td>
      		</tr>
    		</table>
   			<br>
   				<br><br>
   			</td>
  			</tr>
	</table>
	
	<table width="100%" cellspacing="0" cellpadding="4" border="0" style="border-bottom: 1px dotted #5a5a5a">
  	<tr valign="top" bgcolor="<?= $alt=="#d6e6f3"?$alt="#f7f7f7":$alt="#d6e6f3"?>">
    	<td width="300" class="dataTableContent_gm"><b>Hintergrundfarbe der QR-Codes-Box</b></td>
    	<td class="dataTableContent_gm">
    		<table width="100%" cellspacing="0" cellpadding="2" border="0">
			<tr>
        		<td class="dataTableContent_gm">
        			<input type="text" value="<?= $shopgate_config["background_color"] ?>" name="shopgate_config[background_color]" /><br />
        		</td>
      		</tr>
    		</table>
   			<br>
   				<br><br>
   			</td>
  			</tr>
	</table>
	
	<table width="100%" cellspacing="0" cellpadding="4" border="0" style="border-bottom: 1px dotted #5a5a5a">
  	<tr valign="top" bgcolor="<?= $alt=="#d6e6f3"?$alt="#f7f7f7":$alt="#d6e6f3"?>">
    	<td width="300" class="dataTableContent_gm"><b>Schriftrfarbe der QR-Codes-Box</b></td>
    	<td class="dataTableContent_gm">
    		<table width="100%" cellspacing="0" cellpadding="2" border="0">
			<tr>
        		<td class="dataTableContent_gm">
        			<input type="text" value="<?= $shopgate_config["foreground_color"] ?>" name="shopgate_config[foreground_color]" /><br />
        		</td>
      		</tr>
    		</table>
   			<br>
   				<br><br>
   			</td>
  			</tr>
	</table>
	
	<input type="submit" value="Speichern" onclick="this.blur();" class="button">
</form>
<? elseif ($_GET["sg_option"] === "merchant"): ?>
<iframe src="https://www.shopgate.com/users/login/0/2" style="width: 1000px; min-height: 600px; height: 100%; border: 0;"></iframe>
<? endif; ?>								
						</td>
					</tr>
				</table>
			</td>
			<!-- body_text_eof //-->
		</tr>
	</table>
	<!-- body_eof //-->

	<!-- footer //-->
	<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
	<!-- footer_eof //-->
	<br />
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>